package compiler.IR;

import compiler.PrettyPrinter;

public class MJWhile extends MJStatement {
	
	private MJExpression lhs;
	private MJBlock rhs;
	
	public MJWhile(MJExpression lhs, MJBlock rhs){ //We choose to use a block instead of a statement
		this.rhs=rhs;
		this.lhs=lhs;
	}

	public MJExpression getLhs() {
		return this.lhs;
	}

	public MJBlock getRhs() {
		return this.rhs;
	}

	public void prettyPrint(PrettyPrinter prepri) {
		prepri.print("while");
		prepri.print("(");
		this.lhs.prettyPrint(prepri);
		prepri.print(")");
		this.rhs.prettyPrint(prepri);
	}
	
}
